package com.marry.business;


import com.common.web.netty.socket.NettyServer;
import com.thebeastshop.forest.springboot.annotation.ForestScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.Resource;

@ForestScan(basePackages = "com.common.web.service")
@SpringBootApplication
@EnableDiscoveryClient
@EnableAsync
public class MarryBusinessApplication implements CommandLineRunner {

    @Resource
    private  NettyServer nettyServer;

    public static void main(String[] args) throws Exception {
        SpringApplication.run(MarryBusinessApplication.class, args);
    }


    @Override
    @Async("asyncServiceExecutor")
    public void run(String... args) throws Exception {
             nettyServer.start();
    }
}
